<template>
    <view @click="backTop" class="back-top" :class="isShowBackTop ? 'show': ''">
        <text class="icon iconfont icon-fanhuidingbu"></text>
    </view>
</template>

<script setup>
const emit = defineEmits(['backTop'])
defineProps({
    'bottom': {
        type: Number,
        default: 80
    },
    'isShowBackTop': {
        type: Boolean,
        default: false
    }
})

const backTop = () => {
    emit('backTop')
}
</script>

<style lang="scss">
.back-top {
    right: 20px;
    position: absolute;
    bottom: 80px;
    height: 40px;
    width: 40px;
    z-index: 20;
    border-radius: 50%;
    text-align: center;
    background-color: #27BA9B;
    transform: scale(0);
    transition: all 0.2s;
    .icon {
        color: #fff;
        font-size: 30px;
    }
}

.show {
    transform: scale(1);
}
</style>